package com.itheima.chapter09.file;

import java.io.File;

//删除一个多级文件夹
public class FileCase2 {
    public static void main(String[] args) {
        File file =new File("D:\\CloudMusic");
        deleteDir(file);
    }

    private static void deleteDir(File file) {
        File[] files = file.listFiles();
        for (File file1 : files) {
            if (file1.isFile()){
                file1.delete();
            }else {
                deleteDir(file1);
            }
        }
        file.delete();
    }
}
